class TestMetaclass(type):
    def __new__(cls, name, basses, attrs):
        print(cls, name, basses, attrs)
        attrs["add"] = lambda self, value: self.append(value)
        print(dir(attrs["size"]))
        return type.__new__(cls, name, basses, attrs)

class MyList(list, metaclass=TestMetaclass):
    def test(self):
        print("test")
    def add(self):
        print("add")
    @property
    def size(self):
        return 1
    @size.setter
    def size(self, size):
        self._size = size
